import axios from 'axios';

// 分类列表
export function articleList(params) {
  return axios({
    url: `/admin/article/list`,
    method: 'post',
    data: params,
  });
}

// 创建分类
export function articleCreate(params) {
  return axios({
    url: `/admin/article/create`,
    method: 'post',
    data: params,
  });
}

// 更新分类
export function articleUpdate(params) {
  return axios({
    url: `/admin/article/update`,
    method: 'post',
    data: params,
  });
}

// 文章详情
export function articleDetail(params) {
  return axios({
    url: `/admin/article/detail`,
    method: 'post',
    data: params,
  });
}

// 删除分类
export function articleDelete(params) {
  return axios({
    url: `/admin/article/delete`,
    method: 'post',
    data: params,
  });
}

// 分类列表
export function categoryList(params) {
  return axios({
    url: `/admin/articlecategory/list`,
    method: 'get',
  });
}

export function categoryTreeList(params) {
  return axios({
    url: `/admin/articlecategory/treeList`,
    method: 'get',
    params,
  });
}

// 创建分类
export function categoryCreate(params) {
  return axios({
    url: `/admin/articlecategory/create`,
    method: 'post',
    data: params,
  });
}

// 更新分类
export function categoryUpdate(params) {
  return axios({
    url: `/admin/articlecategory/update`,
    method: 'post',
    data: params,
  });
}

// 删除分类
export function categoryDelete(params) {
  return axios({
    url: `/admin/articlecategory/delete`,
    method: 'post',
    data: params,
  });
}
